We plot the eQTL t-scores across the 44 tissues for 3000 cis-eQTLs in the file.
tscore_data=read.table("../data/complete_tscore_eQTL.table.txt");
iplotCurves(tscore_data[1:3000,-1],1:44);
## Set screen size to height=700 x width=1000
We extract the lfspr values for each gene across the different tissues and then we look at the tissue specific effects (if any). Possoble choices of tissues that show tissue specific effects are thyroid, lymphocytes, whole blood and testis. We want to figure out the eQTLs which are specific only to these tissues.
lfsr_data=read.table("../data/lfsr.et_withbma.txt");
post.mean.shrink = read.table("../data/post.mean.et_withbma.normalized.txt");
## read the tissue names
names_tissues <- read.table("../data/names_tissues.txt")[-1];
tissue_names_filtered=unlist(lapply(as.matrix(names_tissues),
function(x) substring(x,32,nchar(x)-7)));
gene_info_eqtl = data.frame(fread("../data/gene_info_eqtl.txt"));
genesnp.names=as.vector(as.matrix(read.table("../data/gene_snp_names.txt")));
gene_names_GTEX=substring(genesnp.names,1,15);
matching_labels_eqtls_to_gene_info= match(gene_names_GTEX,gene_info_eqtl[,1]);
index_not_found=which(is.na(matching_labels_eqtls_to_gene_info)==TRUE);
matching_labels=matching_labels_eqtls_to_gene_info[which(!is.na(matching_labels_eqtls_to_gene_info))];
flag=paste0(gene_info_eqtl[matching_labels,1],", ",
"name-",gene_info_eqtl$Associated.Gene.Name[matching_labels],", ",
"descr-",gene_info_eqtl$Description[matching_labels],",",
"chr-",gene_info_eqtl$Chromosome.Name[matching_labels]);
post.mean.shrink.matched=post.mean.shrink[-index_not_found,];
rownames(post.mean.shrink.matched)=flag;
lfsr_data.matched=lfsr_data[-index_not_found,];
index_tissue=which(tissue_names_filtered=="Cells_EBV-transformed_lymphocytes");
thresh=0.05
##create a matrix showing whether or no lfsr satisfies threshold
sigmat =lfsr_data.matched <= thresh;
sigs=which(rowSums(sigmat)==1)
sigs.it=which(lfsr_data.matched[sigs,index_tissue]<thresh)
iplotCurves(post.mean.shrink.matched[sigs[sigs.it],],1:44)
index_tissue=which(tissue_names_filtered=="Thyroid");
thresh=0.05
##create a matrix showing whether or no lfsr satisfies threshold
sigmat =lfsr_data.matched <= thresh;
sigs=which(rowSums(sigmat)==1)
sigs.it=which(lfsr_data.matched[sigs,index_tissue]<thresh)
iplotCurves(post.mean.shrink.matched[sigs[sigs.it],],1:44)
index_tissue=which(tissue_names_filtered=="Whole_Blood");
thresh=0.05
##create a matrix showing whether or no lfsr satisfies threshold
sigmat =lfsr_data.matched <= thresh;
sigs=which(rowSums(sigmat)==1)
sigs.it=which(lfsr_data.matched[sigs,index_tissue]<thresh)
iplotCurves(post.mean.shrink.matched[sigs[sigs.it],],1:44)
index_tissue=which(tissue_names_filtered=="Testis");
thresh=0.05
##create a matrix showing whether or no lfsr satisfies threshold
sigmat =lfsr_data.matched <= thresh;
sigs=which(rowSums(sigmat)==1)
sigs.it=which(lfsr_data.matched[sigs,index_tissue]<thresh)
iplotCurves(post.mean.shrink.matched[sigs[sigs.it],],1:44)
index_tissue=7:16;
thresh=0.05
##create a matrix showing whether or no lfsr satisfies threshold
sigmat =lfsr_data.matched <= thresh;
lfsr_red=t(apply(lfsr_data.matched,1,function(x){c(x[1:6],min(x[7:16]),x[17:44])}))
sigs=which(rowSums(sigmat)==1)
sigs.it=which(lfsr_red[sigs,index_tissue]<thresh)
iplotCurves(post.mean.shrink.matched[sigs[sigs.it],],1:44)
index_tissue=1:44;
thresh=0.05
##create a matrix showing whether or no lfsr satisfies threshold
sigmat =lfsr_data.matched <= thresh;
sigs=which(rowSums(sigmat)==44);
iplotCurves(post.mean.shrink.matched[sigs,],1:44)